<!-- /* Description for file.
 * RSS发布
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/resources
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张朋2011年0701
 * @lastmodified  张海杰2011年0702
 */
 -->
<?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
?>
<script type="text/javascript">
$(function(){
	$(".deletebutton").click(function(){
		var delArr = $(".tab1 :checkbox:checked");
		if(delArr.length==0)
		{
			alert("请选择你要删除的项!");
			return;
		}
		var ids="";
		$(":checkbox[checked=true]").each(function(i,n)
		{
			var id=$(this).val();
			
			ids=ids+id+"-";
		 });
		$(".ids").val(ids);
		//alert($(".ids").val());
		$("#df").submit();
	});
});
//Form验证
$(document).ready(function() {
	 $.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	// validate signup form on keyup and submit
	$("#SystemconfigAddrssForm").validate({
		rules: {
			title: {
				required: true,string: true 
			},
			link: {
				required: true ,url:true
			},
			maxitem: {
				required: false,digits:true,min:0,max:50
			}
		},
		messages: {
			maxitem: {
			required:  "请输入内容"
			}
		},
		//设置验证触发事件 
		focusInvalid: false, 
		onkeyup: false, 
		//设置错误信息提示DOM  
		errorPlacement: function(error, element) { 
		error.appendTo( element.parent()); 
		}
	});
	$("#df").validate({
	
	});
	
});
</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Systemconfigs');//一级目录
										   echo '>';echo __('Rss Set');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Systemconfig addrss',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">
	<fieldset><legend><?php __('Systemconfig addrss');?></legend>
<!-- 新增form-->
		<?php echo $form->create('Systemconfig',array('action'=>'addrss','type'=> 'post'));?>
		<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
		<tr>
			<td width="50"></td>
			<td width="100"><?php __('RSStitle');//标题?>:<font color="red">*</font></td>
			<td colspan="4"><?php echo $form->text('title',array('name'=>'title','class' => 'TextBoxL txtOut','lable'=>false)); ?></td>
		</tr>
		<tr>
			<td width="50"></td>
			<td width="100"><?php __('RSSlink');//链接?>:<font color="red">*</font></td>
			<td colspan="4"><?php echo $form->text('link',array('name'=>'link','class' => 'TextBoxL txtOut','lable'=>false)); ?>
			</td>
		</tr>
		<tr>
			<td width="50"></td>
			<td width="100"><?php __('RSSmostmenu');//最大显示条数?>:</td>
			<td colspan="4"><?php echo $form->text('maxitem',array('name'=>'maxitem','class' => 'TextBoxL txtOut','lable'=>false)); ?></td>
		</tr>
		</table>
		<ul> 
			<li style="width:30%;float:left;margin-left:16%;"><?php echo $form->button('确定',array('type'=>'submit','class'=>'newsubmit'));?></li>
			<?php echo $form->end();?>	
	
	<!-- 删除form-->
			<form action="<?php echo ROOT_WEB_PATH; ?>/systemconfigs/delrss" method="post" id="df">
			<input type="hidden" value="" name="ids" class="ids"></input>
			<li><?php echo $form->button('删除',array('type'=>'button','class'=>'deletebutton'));?></li>
			</form>	
		</ul>
	</fieldset>
</div>

<!-- RSS管理 -->
<div id="nav1" style="width:97%">
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo __('Selected');?></th>
		<th ><?php echo __('RSStitle');?></th>
		<th ><?php echo __('RSSlink');?></th>
		<th ><?php echo __('RSSmostmenu');?></th>
	</tr>
	<?php for ($index = 0; $index < count($result); $index++) {
		$id=$result[$index]['rsses']['id'];
		$title=$result[$index]['rsses']['title'];
		$link=$result[$index]['rsses']['link'];
		$maxitem=$result[$index]['rsses']['maxitem'];
		?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td>
<!-- 选择 -->				
			<?php echo $form->checkbox($id, array('value' => $id));?>
			</td>
			<td title="<?php echo $title;?>"><?php echo $title;?></td>
			<td title="<?php echo $link;?>"><?php echo $link;?></td>
			<td><?php echo $maxitem;?></td>
		</tr> 
	<?php
}?>
</table>
</div>
<!-- RSS管理 -->

